var ineoAjaxUrl           = 'index.php?autocom=ineo&mod=xml&';	
var ineoAjaxRequestType   = 'GET';
var ineoAjaxPostData      = '';
var ineoAjaxRequest       = new ajax_request();

ineoAjaxRequest.xml_init();

/**
* Standard Ineo AJAX call, replaces returned content into an area defined by it's ID.
*/
function ineoAjaxReplace( urlParams , contentAreaId , loadingMessage )
{
	if( loadingMessage != null )
	{
		ineoAjaxRequest.show_loading( loadingMessage );
	}
	
	var myEvent = function()
	{
		if( ineoAjaxRequest.readystate_ready_and_ok() )
		{
			ineoAjaxReplaceEvent( contentAreaId , ineoAjaxRequest.xmlhandler.responseText )
		}
	}
	
	ineoAjaxRequest.onreadystatechange( myEvent );
	
	ineoAjaxRequest.process( ineoAjaxUrl + urlParams , ineoAjaxRequestType , ineoAjaxPostData );
}

/**
* Ineo AJAX Call With Event Handler
*/
function ineoAjaxEvent( urlParams , eventHandler , loadingMessage )
{
	if( loadingMessage != null )
	{
		ineoAjaxRequest.show_loading( loadingMessage );
	}
	
	ineoAjaxRequest.onreadystatechange( eventHandler );
	
	ineoAjaxRequest.process( ineoAjaxUrl + urlParams , ineoAjaxRequestType , ineoAjaxPostData );
}

/**
* ineoAjaxReplace event handler
*/
function ineoAjaxReplaceEvent( contentArea , newContent )
{
	// Hide our loading message:
	ineoAjaxRequest.hide_loading();
	
	// Get and show the content area:
	var dyn = document.getElementById(contentArea);
	dyn.style.display = '';
	
	// Replace content into the area:
	dyn.innerHTML = newContent;
		
	return true;
}

/**
* Get ajax request response text
*/
function ineoAjaxResponseText()
{
	return ineoAjaxRequest.xmlhandler.responseText;
}

/**
* Ajax ready and ok state?
*/
function ineoAjaxReady()
{
	return ineoAjaxRequest.readystate_ready_and_ok();
}

